package com.pjchat.pjchatclient.validator;



public class PasswordValidator {
	public static boolean checkPassword(String password) {
		// length
		if (password.length() < 6 || password.length() > 15)
			return false;
		// 0-9,a-z,A-Z,@,_
		for (int i = 0; i < password.length(); i++) {
			char c = password.charAt(i);
			if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || c == '@' || c == '_')) {
				System.out.println(c);
				return false;
			}
		}
		return true;
	}
}
